import 'package:flutter/material.dart';
import 'package:flutter_massage/pages/message/message_bean.dart';
import 'package:flutter_massage/pages/model/bean.dart';
import 'package:flutter_massage/pages/my/address/address_bean.dart';
import 'package:flutter_massage/pages/technician/place_order/order_bean.dart';

abstract class DbInterface {
  ///打开数据库
  Future openDb();

  ///关闭数据库
  Future closeDb();

  ///新增地址
  Future addAddress(AddressBean addressBean);

  ///编辑地址
  Future editAddress(AddressBean addressBean);

  ///删除地址
  Future deleteAddress(String addressId);

  ///地址列表
  Future<List<AddressBean>> getAddressList();

  ///插入消息
  Future insertMessage({required MessageBean messageBean});

  ///获取消息列表
  Future<List<MessageBean>> getMessageList({required String chatId});

  ///获取会话列表
  Future<List<ChatBean>> getChatList({required String userId});

  ///插入、更新会话
  Future updateChat({required ChatBean bean});

  ///更新会话的最后一条消息内容
  Future updateChatLastMessage({required String chatId, required String lastMessage});

  ///保存订单
  Future saveOrder({
    required String orderId,
    required String time,
    required String desc,
    required AddressBean addressBean,
    required TechnicianBean technicianBean,
    required ProjectBean projectBean,
  });

  ///订单列表
  void getOrderList({required ValueChanged<List<OrderBean>> complete});
}
